package jblip.apps.clip.cmds;

import jblip.BlipClient;
import jblip.apps.clip.ClipPrinter;
import jblip.resources.User;

public class Whois extends ClipCommand {

  @Override
  public String getName() {
    return "whois";
  }

  @Override
  public String getUsageMessage() {
    return "<username>";
  }
  
  @Override 
  public void execute(BlipClient client, String[] args) {
    User who = client.getUser(args[0]);
    if (client.getLastError() == null) {
      ClipPrinter.print(who);
    } else {
      System.out.println("ERROR: " + client.getLastError().toString());
    }
  }
}
